<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page contentType="text/html;charset=UTF-8" language="java"  pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="spring" uri="/WEB-INF/lib/spring.tld"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="f" %>
<%@ taglib prefix="z" uri="/WEB-INF/lib/zerdoor.tld"%>
<c:set value="${pageContext.request.contextPath}" var="path" scope="page"/>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><spring:message code='task_info.title.taskInfo' /></title>
    <link href="${path}/style/acg/css/style.css" rel="stylesheet" type="text/css" />
    <link rel="stylesheet" media="screen" href="${path}/plugins/validate/validate.css">
    <script src="${path}/js/jquery.min.js" type="text/javascript"></script>
    <script src="${path}/plugins/validate/jquery.validate.min.js" type="text/javascript"></script>
    <c:if test="${ sessionScope.language != 'en'}">
        <script src="${path}/plugins/validate/messages_cn.js" type="text/javascript"></script>
    </c:if>
    <%--<script type="text/javascript" src="${path}/js/jquery-2.1.1.js"></script>--%>
    <%--<script type="text/javascript" src="${path}/style/acg/js/common.js"></script>--%>

    <!-- 文件上传JS -->
    <script type="text/javascript" src="${path}/js/ajaxfileupload.js"></script>


    <script type="text/javascript">

        $(function(){

            if("${curUser.userId}" == "" ){

                alert("<spring:message code='race_info.alert.tipLogin' />");
                window.location.href = "${path}/login/index.html"

                return;
            }

            f_init();

            //处理从下一页返回回来
            f_backPage();

        });
        var validate = null;
        //初始化函数
        function f_init(){
            //初始化一级分类

            f_findPajectType(1,"first_class");

            $("#first_class").change(function(){
                f_findPajectType($(this).val(),"second_class");
            });



            //绑定选择框事件
            $(".zsys input[type='checkbox']").click(function(){


                if(!$(this).attr("checked")){
                    $(this).attr("checked","checked");
                }else{
                    $(this).removeAttr("checked");
                }

            });

            //加入验证
            //f_saveItem();


            validate = $("#taskForm").validate({
                rules : {
                    title:{
                        required: true
                    },
                    description:{
                        required: true
                    },
                    skill:{
                        required: true
                    },

                    budget:{
                        required: true,
                        number: true
                    },


                    pieceNum:{
                        min:0,
                        max:10,
                        number:true
                    },
                    selfDescription:{
                        required: true
                    }
                },
                messages : {

                },
                success: function(label) {//验证成功添加样式
                    label.html("&nbsp;").removeClass("checked").addClass("checked");
                }

            });
        }

        /**级联查询分类*/
        function f_findPajectType(parent,selID){

            $.post("${path}/taskList/findTaskTypeByParent.html", { parent: parent},
                    function(data, textStatus){

                        var tempArr = new Array();
                        var html = "";
                        for (i in data) {

                            var type = data[i];
                            html += "<option value='" + type.id + "' skill='"+type.skill+"'>" + type.name + "</option>";
                            tempArr.push(type.id);
                        }

                        $("#"+selID).html(html);

                        //如果为一级分类，则默认初始化二级分类
                        if("first_class" == selID){

                            //返回处理
                            if($("#first_class_type").val() != "" && $("#first_class_type").val() != null){
                                $("#"+selID).val($("#first_class_type").val());
                            }

                            f_findPajectType($("#"+selID).val(),"second_class");
                        }else{

                            //返回处理
                            if($("#second_class_type").val() != "" && $("#second_class_type").val() != null){

                                var second_class_type = parseInt($("#second_class_type").val());
                                var boo = false;
                                for(var item in tempArr){

                                    if(second_class_type == tempArr[item]){
                                        boo = true;
                                    }
                                }
                                if(boo){
                                    $("#"+selID).val($("#second_class_type").val());
                                }


                            }

                            f_findSkill();
                        }

            });
        }


        /**级联查询需求技能*/
        function f_findSkill(){

            var skill = $("#second_class").find("option:selected").attr("skill");

            if(skill == ""){
                $(".skill_list").html("");
                return;
            }

            $.post("${path}/taskInfo/findSkillBySkillIds.html", { skillIds: skill},
                    function(data, textStatus){

                        var html = "";
                        for (i in data) {

                            var type = data[i];
                            html += "<a href=\"javascript:;\" class=\"skill_li\" value=\""+type.id+"\">"+type.name+"</a>";
                        }

                        $(".skill_list").html(html);


                        f_aClick(".skill_list a","#skill");



                        if(!booBackSkill){
                            $("#skill").val("");

                            return;
                        }

                        //处理返回
                        var skill = $("#skill").val();
                        var skill_arr = skill.split(",");
                        for(var i in skill_arr){

                            if(skill_arr[i] != ""){
                                $(".skill_list a").each(function(){

                                    if($(this).attr("value") == skill_arr[i]){
                                        $(this).addClass("selected");

                                    }
                                });

                            }

                        }
                        booBackSkill = false;

                    });
        }

        //Ajax文件上传
        function f_file_upload(fileInputId){

            //var result =/\.[^\.]+/.exec($("#fulAchievements").val());

            var path = $("#"+fileInputId).val();

            var pos1 = path.lastIndexOf("\\");
            var pos2 = path.lastIndexOf(".");
            var pos = path.substring(pos1 + 1, pos2);

            var fileName = path.substring(pos1+1,pos2);

            var str = $("#"+fileInputId).val().split(".");
            var result = path.substring(pos2 + 1,path.length );

            var rars = ".rar.zip.7z.cab.RAR.ZIP.7Z.CAB";

            var imgs = ".bmp.jpg.dib.jpeg.png.jfif.jpe.tif.tiff.gif.BMP.JPG.DIB.JPEG.PNG.JFIF.JPE.TIF.TIFF.GIF";

            //文件类型 false为压缩包
            var boo = false;

            //判断上传的是项目图片还是项目附件
            if("fulAchievements1" == fileInputId){
                if(imgs.indexOf(result) > -1){
                    boo = true;

                }else{

                    alert(" <spring:message code='task_info.alert.upload' arguments='.bmp.jpg.dib.jpeg.png.jfif.jpe.tif.tiff.gif' argumentSeparator=',' />");
                    $("#"+fileInputId).val("");
                    return;
                }
            }else{

                if(rars.indexOf(result) > -1){
//                    console.log("压缩包");
                }else if(imgs.indexOf(result) > -1){
                    boo = true;
//                    console.log("图片");
                }else{

                    alert("<spring:message code='task_info.alert.upload2' arguments='.rar.zip.7z.cab,.bmp.jpg.dib.jpeg.png.jfif.jpe.tif.tiff.gif' argumentSeparator=','/>")
                    $("#"+fileInputId).val("");
                    return;
                }
            }

            $.ajaxFileUpload({
                url: '${path}/fileUpload/upload_resource_file.html',
                secureuri: false,
                fileElementId: fileInputId,
                //dataType: 'json',
                success: function (data) {
                    //data = $.parseJSON(data);

                    var data2 = data.split(",");

                    var url = data2[0].replace(" ","");
                    fileName = data2[1].replace(" ","");

                    var src = "${path}/style/common/images/yasuobao.png";
                    if(boo){
                        src = "${path}/"+url;
                    }

                    if("fulAchievements1" == fileInputId){
                        f_item_pic(src,url,fileName);
                    }else{
                        f_attachment(src,url,fileName);
                    }



                },
                error:function(data){

                    console.log("error");
                    console.log(data);
                }
            });
        }

        //项目图片
        function f_item_pic(src,url,fileName){

            var html = "";

            html += "<li>";
            html += "<em class='ico_del' onclick=\"f_removeAttchment('"+url+"',this,'item_pic',true)\" >×</em>";
            html += "<img src='"+src+"' width='56' height='70' />";
            html += "        <p>"+fileName+"</p>";

            if($("#item_pic").val() == "" && $("#item_front_cover").val() == ""){
                html += "<a onclick=\"f_setCover('"+url+"',this)\"   ><spring:message code='task_info.msg.projectCover' /></a>";

                $("#item_front_cover").val(url);



            }else if( $("#item_front_cover").val() != "" && url == $("#item_front_cover").val()) {

                    html += "<a onclick=\"f_setCover('"+url+"',this)\"   ><spring:message code='task_info.msg.projectCover' /></a>";

            }else{

                html += "<a onclick=\"f_setCover('"+url+"',this)\"   ><spring:message code='task_info.msg.makeCover' /></a>";
            }

            html += "</li>";

            //设置值
            $("#item_pic").val($("#item_pic").val()+ url + "," );
            //显示
            $("#item_pic_ul").html($("#item_pic_ul").html() + html);

            f_validateText("item_pic","item_pic_msg");

        }
        //项目附件
        function f_attachment(src,url,fileName){
            var html = "";

            html += "<li>";
            html += "<em class='ico_del' onclick=\"f_removeAttchment('"+url+"',this,'attachment',false)\" >×</em>";
            html += "<img src='"+src+"' width='56' height='70' />";
            html += "        <p>"+fileName+"</p>";


            html += "</li>";

            //设置值
            $("#attachment").val($("#attachment").val()+ url + "," );
            //显示
            $("#attachment_ul").html($("#attachment_ul").html() + html);
        }

        //根据附件数组下标删除元素
        function f_removeAttchment(url,obj,inputId,flag){


            if(flag){

                if($("#item_front_cover").val() == url){

                    alert("<spring:message code='task_info.alert.projectCover' />")
                    return;
                }

            }

            //把数组元素赋空值
            $("#" + inputId).val($("#" + inputId).val().replace(url + ",",""));

            //删除元素
            $(obj).parent().remove();

        }

        //设置为封面
        function f_setCover(url,obj){


            $("#item_pic_ul").find("a").each(function(){

                $(this).html("<spring:message code='task_info.msg.makeCover' />")
            });

            $("#item_front_cover").val(url);

            $(obj).html("<spring:message code='task_info.msg.projectCover' />");

        }

        /**a点击事件 传入选择器*/
        function f_aClick(selID,inputID){

            $(selID).click(function() {


                if($(this).attr("class").indexOf("selected") > -1){
                    $(this).removeClass("selected");

                    //$(inputID).val($(inputID).val().replace($(this).attr("value")+",",""));
                    var tempArr = $(inputID).val().split(",");

                    for(var i in tempArr){

                        if(tempArr[i] == $(this).attr("value")){

                            tempArr.splice(i,1);

                        }
                    }

                    $(inputID).val(tempArr.join(","));
                }else{
                    $(this).addClass("selected");

                    if(inputID != null && inputID != undefined){

                        var sp = "";

                        if($(inputID).val()!=null && $(inputID).val() != ""){
                            var str = $(inputID).val().substring($(inputID).val().length - 1 ,$(inputID).val().length);

                            if(str != ","){
                                sp = ",";
                            }
                        }


                        $(inputID).val( $(inputID).val()+ sp + $(this).attr("value") + ",");
                    }
                }



            });

        }

    //按钮加一事件
    function f_buttonAdd(inputId,radioId){

        //如果为空 那么久赋值为1，否者取出原来的值进行加一
        if($("#"+inputId).val() == ""){


            $("#"+inputId).val("1")
        }else{


            $("#"+inputId).val(parseInt($("#"+inputId).val()) + 1 );
        }

        //如果radioID有值，那么就赋值
        if(radioId != undefined){
            $("#"+radioId).val($("#"+inputId).val());
        }

    }

    //按钮减一事件
    function f_buttonMinus(inputId,radioId){

        //如果为空 那么久赋值为1，否者取出原来的值进行减一
        if($("#"+inputId).val() == "" || $("#"+inputId).val() == "1"){

            $("#"+inputId).val("1");
        }else{

            $("#"+inputId).val(parseInt($("#"+inputId).val()) - 1 );
        }

        //如果radioID有值，那么就赋值
        if(radioId != undefined){
            $("#"+radioId).val($("#"+inputId).val());
        }
    }

        //设置radio值
    function f_setRadio(radioId,obj){

        $("#"+radioId).val($(obj).val());

    }

    //预算未定处理事件
    function f_unBudget(obj){

        if($(obj).attr("checked")){
            $(obj).removeAttr("checked");

            $("#budget").val("0");
            $("#budget").show();
            $("#budget_msg").hide();
            $("#budget").removeAttr("disabled");
            $("#is_deposit").val("101001");
            $("#is_deposit").removeAttr("disabled");
        }else{
            $(obj).attr("checked","checked");

            $("#budget").val("-1");

            $("#budget").hide();
            $("#budget_msg").show();

            $("#budget").attr("disabled",true);
            $("#is_deposit").val("101002");
            $("#is_deposit").attr("disabled",true);

        }

    }

    //保存项目信息
    function f_saveItem(){


            var boo = f_validates();

            if(!boo ){
                return;

            }
            var boo2 = validate.form();
            if( !boo2){
                return;

            }



        <%--,--%>
            <%--submitHandler : function(){--%>


                $("#addvalue_ids").val("");
                $("#addValueDD input[type='checkbox']").each(function(i){


                    if($(this).attr("checked")){
                        $("#addvalue_ids").val( $(this).val() + "," + $("#addvalue_ids").val() );
                    }

                });
            var ids = $("#addvalue_ids").val();
             if( ids != ""){

                 $("#addvalue_ids").val(ids.substring(0,ids.length - 1));
             }

            var skill =$("#skill").val();
            if( skill != ""){

                $("#skill").val(skill.substring(0,skill.length - 1));
            }

            var boo_is_deposit = true;
            //判断托管定金下拉框是否有disabled属性，如果有则取消
            if($("#is_deposit").attr("disabled")){
                $("#is_deposit").removeAttr("disabled");
                boo_is_deposit = false;
            }
            if($("#budget").attr("disabled")){
                $("#budget").removeAttr("disabled");

            }
            var boo_piece_num = true;
            if($("#piece_num").attr("disabled")){
                $("#piece_num").removeAttr("disabled");
                boo_piece_num = false;
            }

            $.post("${path}/taskInfo/insertTaskInfo.html",
                        $("#taskForm").serialize()
                        ,function(data){
                            if(data != "error" && data != "debug"){
                                //alert("<spring:message code="bid.result_success"/>");
                                $("#item_id").val(data);


                                //还原下拉框为不可点击
                                if(!boo_is_deposit){
                                    $("#is_deposit").attr("disabled");
                                }
                                if($("#budget").val() == "-1"){
                                    $("#budget").attr("disabled");

                                }
                                if(!boo_piece_num){
                                    $("#piece_num").attr("disabled");
                                }

                                //赋值给临时表单
                                $("#first_class_type").val($("#first_class").val());
                                $("#second_class_type").val($("#second_class").val());

                                 window.location = "${path}/taskInfo/confirmTaskInfo.html?taskId="+data;
                            }else if(data == "debug"){

                                alert("<spring:message code='task_info.alert.paid' />");

                            }else{
                               // alert("<spring:message code="bid.result_fail"/>");
                            }
                        });
            <%--}--%>

        }

    function f_validates(){

        //验证只能是数字
        var boo1 = f_validateNumber("first_rate","rate_msg");
        var boo2 = f_validateNumber("second_rate","rate_msg");
        var boo3 = f_validateNumber("three_rate","rate_msg");
        var boo4 = f_validateNumber("i_bid_time","bid_time_msg");
        var boo5 = f_validateNumber("cycle","cycle_msg");
        var boo6 = f_validateNumber("piece_num","piece_num_msg");
        var boo7 = f_validateText("item_pic","item_pic_msg");

        if(boo1 && boo2 && boo3 && boo4 && boo5 && boo6 && boo7){

            var booRate = f_validateRate();
            if(!booRate){
                return false;
            }

            return true;
        }

        return false;

    }

        function f_validateRate(){

            var first_rate = parseFloat($("#first_rate").val());
            var second_rate = parseFloat($("#second_rate").val());
            var three_rate = parseFloat($("#three_rate").val());

            if((first_rate + second_rate + three_rate) != 100){
                $("#rate_msg").html("<label id='title-error' class='error'  for='three_rate'>三个阶段的和必须为100%！</label>");

                return false;
            }


            return true

        }

    //验证表单是否为空，传入输入框ID和提示标签ID
    function f_validateText(inputId,msgId){

        if($("#" + inputId).val().replace(/\s+/,'') != ''){
            $("#"+msgId).html("<label id='title-error' class='error checked' for='"+inputId+"'>&nbsp;</label>");
            return true;
        }

        $("#"+msgId).html("<label id='title-error' class='error'  for='"+inputId+"'><spring:message code='task_info.label.requiredFields' /></label>");

        return false;

    }

    //验证是否是数字，传入输入框ID和提示标签ID
    function f_validateNumber(inputId,msgId){


            //定义正则表达式部分
            //var reg = /^\d+$/;
            var reg = /^[.0-9]+$/;
            if( $("#"+inputId).val().constructor === String ){
                var re = $("#"+inputId).val().match( reg );
                if(re != null){
                    $("#"+msgId).html("<label id='title-error' class='error checked' for='"+inputId+"'>&nbsp;</label>");
                    return true;
                }

            }
            $("#"+msgId).html("<label id='title-error' class='error'  for='"+inputId+"'><spring:message code='task_info.label.legalDigital' /></label>");
            $("#"+inputId).blur(function(e){
                f_validateNumber(inputId,msgId);
            });
            return false;
    }

    var booBackSkill = false;
    //处理从上一页返回回来的操作
    function f_backPage(){

        //如何item_id为空，那么就默认不处理
        if($("#item_id").val() == ""){
            return;
        }
        booBackSkill = true;

        //取出隐藏表单中的值
        var item_pic = $("#item_pic").val();
        var item_front_cover = $("#item_front_cover").val();
        var attachment = $("#attachment").val();


        if($("#budget").val() == -1){
            $("#budget").hide();
            $("#budget_msg").show();
        }else{
            $("#budget").show();
            $("#budget_msg").hide();
        }

        //赋空值
        $("#item_pic").val("");
        $("#item_front_cover").val("");
        $("#attachment").val("");

        //处理项目图片
        var item_pic_arr = item_pic.split(",");
        for(var i in item_pic_arr){

            if(item_pic_arr[i] != ""){

                var src = "${path}/" + item_pic_arr[i];
                var url = item_pic_arr[i];
                var fileName = item_pic_arr[i].replace(/^.*[\\\/]/, '');

                f_item_pic(src,url,fileName);
            }

        }

        //处理附件
        var attachment_arr = attachment.split(",");
        for(var i in attachment_arr){

            if(attachment_arr[i] != ""){

                var src = "${path}/" + attachment_arr[i];
                var url = attachment_arr[i];
                var fileName = attachment_arr[i].replace(/^.*[\\\/]/, '');

                var path = url;
                var pos1 = path.lastIndexOf("\\");
                var pos2 = path.lastIndexOf(".");
                var pos = path.substring(pos1 + 1, pos2);
                //var fileName = path.substring(pos1+1,pos2);
                var str = url.split(".");
                var result = path.substring(pos2 + 1,path.length );
                var rars = ".rar.zip.7z.cab.RAR.ZIP.7Z.CAB";


                if(rars.indexOf(result) > -1) {
                    //console.log("压缩包");

                    src = "${path}/style/common/images/yasuobao.png";
                }
                f_attachment(src,url,fileName);
            }

        }




        //处理增值服务
        var addvalue_ids = $("#addvalue_ids").val().split(",");


        for(var i in addvalue_ids){

            if(addvalue_ids[i] != ""){

                $(".zsys input[type='checkbox']").each(function(){

                    if($(this).val() == addvalue_ids[i]){

                        $(this).attr("checked","checked");
                    }

                });


            }


        }




    }

    //是否计件任务处理函数
    function f_is_piece(val){

        if("101001" == val){
            $("#piece_num").val(1);
            $("#piece_num").attr("disabled",false);
            $(".is_piece input[type='button']").attr("disabled",false);

        }else{

            $("#piece_num").val(0);
            $("#piece_num").attr("disabled",true);
            $(".is_piece input[type='button']").attr("disabled",true);


        }

    }

    function f_isDeposit(value){

        if(value == ""){
            return;
        }
        if(/\D/.test(value)){
            return;
        }
        if(parseFloat(value) > 2000){

            $("#is_deposit").removeAttr("disabled");

        }else{
            $("#is_deposit").val(101001);
            $("#is_deposit").attr("disabled","disabled");

        }


    }


    </script>
</head>

<body>
<div class="header">
    <jsp:include page="../public/header.jsp">
        <jsp:param    name="home"    value="dddd"    />
    </jsp:include>
</div>
<div id="container" >
    <div class="wrapper">
    	<div class="referbidbox">
        	<div class="refer_step step1">
            	<ul>
                	<li class="now"><spring:message code='task_info.msg.descriptionDemand' /></li>
                    <li><spring:message code='task_info.msg.identificationOfNeeds' /></li>
                    <li class="last"><spring:message code='task_info.msg.demandRelease' /></li>
                </ul>
            </div>
        	<div class="referform nomorder">
            <form id="taskForm" name="taskForm"  method="POST">

            <input type="hidden" id="item_id" name="item_id"/>
            	<ul>
                	<li class="formli">
                    	<dl class="clearfix">
                        	<dt><spring:message code='task_info.msg.projectTitle' /></dt>
                            <dd><input type="text" name="title" id="title" value="" class="input_txt" /></dd>
                        </dl>
                    </li>
                	<li class="formli">
                    	<dl class="clearfix">
                        	<dt><spring:message code='task_info.msg.itemDescription' /></dt>
                            <dd><textarea class="text_con" id="description" name="description"></textarea>
                                <%--<input type="text" id="" name="" value="" class="text_con" />--%>
                            </dd>
                        </dl>
                    </li>
                    <li class="formli">
                        <dl class="clearfix">
                            <dt><spring:message code='task_info.msg.projectPictures' /></dt>
                            <dd>
                                <div class="project_files">
                                    <ul class="clearfix" id="item_pic_ul">


                                    </ul>
                                </div>
                            </dd>
                        </dl>
                    </li>
                    <li class="formli">
                        <dl class="clearfix">
                            <dt>&nbsp;</dt>
                            <dd>
                                <input type="button" name="" onclick="javascript:$(this).next().trigger('click')" class="addgrey_btn" value="<spring:message code='task_info.button.addItemPicture' />" />
                                <input  type="file" style="display: none;" name="file" id="fulAchievements1" onchange="f_file_upload('fulAchievements1')" />
                                <input type="hidden" name="item_pic" id="item_pic" />
                                <input type="hidden" name="item_front_cover" id="item_front_cover" />
                                <label id="item_pic_msg"></label>
                            </dd>
                        </dl>
                    </li>

                	<li class="formli">
                    	<dl class="clearfix">
                        	<dt><spring:message code='task_info.msg.postAttachments' /></dt>
                            <dd>
                            	<div class="project_files">
                                    <ul class="clearfix" id="attachment_ul">

                                    </ul>
                                </div>
                            </dd>
                        </dl>
                    </li>
                	<li class="formli">
                    	<dl class="clearfix">
                        	<dt>&nbsp;</dt>
                            <dd>
                                <input type="button" name="" onclick="javascript:$(this).next().trigger('click')" class="addgrey_btn" value="<spring:message code='task_info.button.addAttachments' />" />
                                <input style="display: none" type="file" name="file" id="fulAchievements2" onchange="f_file_upload('fulAchievements2')">
                                <input type="hidden" name="attachment" id="attachment" value="">

                            </dd>
                        </dl>
                    </li>
                	<li class="formli">
                    	<dl class="clearfix">
                        	<dt><spring:message code='task_info.msg.category' /></dt>
                            <dd class="clearfix">
                            	<select name="first_class" id="first_class" class="select">

                                </select>
                            	<select name="second_class" id="second_class" class="select" onchange="f_findSkill()">

                                </select>

                                <input type="hidden" id="first_class_type" value="">
                                <input type="hidden" id="second_class_type" value="">
                            </dd>
                        </dl>
                    </li>
                	<li class="formli">
                    	<dl class="clearfix">
                        	<dt ><spring:message code='task_info.msg.demandForSkills' /></dt>
                            <dd class="clearfix skill_list">
                            	<%--<a href="javascript:;" class="skill_li selected">技能名称</a>--%>
                            	<%--<a href="javascript:;" class="skill_li">技能名称</a>--%>
                            	<%--<c:forEach items="${initData.skillList}" var="skill">--%>
                                    <%--<a href="javascript:;" class="skill_li" value="${skill.id}">${skill.name}</a>--%>
                            	<%--</c:forEach>--%>
                            </dd>
                            <input type="hidden" id="skill" name="skill" value="">
                        </dl>
                    </li>
                	<li class="formli">
                    	<dl class="clearfix">
                        	<dt><spring:message code='task_info.msg.demandStyle' /></dt>
                            <dd class="clearfix">
                            	<select name="style" id="style" class="select">

                                    <c:forEach items="${initData.styleList}" var="style">
                                        <option value="${style.id}">${style.name}</option>
                                    </c:forEach>

                                </select>
                             </dd>
                        </dl>
                    </li>
                	<li class="formli">
                    	<dl class="clearfix">
                        	<dt><spring:message code='task_info.msg.pieceTask' /></dt>
                            <dd class="clearfix">
                            	<select id="is_piece" name="is_piece" class="select" onchange="f_is_piece(this.value)">
                                    <option value="101002"><spring:message code='task_info.option.noPieceTask' /></option>
                                    <option value="101001"><spring:message code='task_info.option.pieceTask' /></option>
                                </select>
                                <div class="txtnumber is_piece">
                                	<input type="text" id="piece_num" name="piece_num" value="1" class="input_num" />
                                    <input type="button" class="btn_add" value="+" onclick="f_buttonAdd('piece_num')" />
                                    <input type="button" class="btn_jian" value="-" onclick="f_buttonMinus('piece_num')" />
                                </div>
                                <label id="piece_num_msg"></label>
                                <%--<input type="text" id="" name="" value="计件任务若有相关说明描述请在此填写" class="remark_input" />--%>
                             </dd>
                        </dl>
                    </li>
                	<li class="formli">
                    	<dl class="clearfix">
                        	<dt><spring:message code='task_info.msg.tenderPrices' /></dt>
                            <dd class="clearfix">
                            	<input type="text" id="budget"  name="budget" value="0" class="money_input" onblur="f_isDeposit(this.value)"  />
                                <input type="text" id="budget_msg"  name="budget_msg" value="不定" class="money_input" disabled style="display: none;" />
                                <label><spring:message code='task_info.msg.yuan' /><em class="grey">（<spring:message code='task_info.msg.RMB' />）</em></label>
                                <input type="checkbox"  name="" value="" onclick="f_unBudget(this)"  class="check_sel" />
                                <label><spring:message code='task_info.msg.budgetUndecided' /></label>
                             </dd>
                        </dl>
                    </li>
                	<li class="formli">
                    	<dl class="clearfix">
                        	<dt><spring:message code='task_info.msg.timeBidding' /></dt>
                            <dd class="clearfix">
                            	<input type="radio" name="bid_time" value="15" checked="checked" class="radio_sel" id="bid_time1" /><label for="bid_time1"><spring:message code='task_info.msg.standard15Days' /></label>
                            	<input type="radio" name="bid_time" value="7" class="radio_sel" id="bid_time2"/><label for="bid_time2"><spring:message code='task_info.msg.urgent7Days' /></label>

                            	<input type="radio"  name="bid_time" id="bid_time" value="10" class="radio_sel" /><label for="bid_time"><spring:message code='task_info.msg.custom' /></label>
                                <div class="txtnumber">
                                	<input type="text" id="i_bid_time" name="i_bid_time" value="10" onchange="f_setRadio('bid_time',this)" class="input_num" />
                                    <input type="button" class="btn_add" value="+" onclick="f_buttonAdd('i_bid_time','bid_time')"/>
                                    <input type="button" class="btn_jian" value="-" onclick="f_buttonMinus('i_bid_time','bid_time')"/>
                                </div>
                                <label for="bid_time"><spring:message code='task_info.msg.day' /></label>
                                <label id="bid_time_msg"></label>
                             </dd>
                        </dl>
                    </li>
                    <li class="formli">
                        <dl class="clearfix">
                            <dt><spring:message code='task_info.msg.projectCycle' /></dt>
                            <dd class="clearfix">

                                <div class="txtnumber">
                                    <input type="text" id="cycle" name="cycle" value="10" class="input_num" />
                                    <input type="button" class="btn_add" value="+" onclick="f_buttonAdd('cycle')"/>
                                    <input type="button" class="btn_jian" value="-" onclick="f_buttonMinus('cycle')"/>
                                </div>
                                <label ><spring:message code='task_info.msg.day' /></label>
                                <label id="cycle_msg"></label>
                            </dd>
                        </dl>
                    </li>
                	<li class="formli">
                    	<dl class="clearfix">
                        	<dt><spring:message code='task_info.msg.taskStage' /></dt>
                            <dd class="clearfix">
                            	<div class="publish_time">
                                	<input type="text" id="first_rate" name="first_rate" value=""/>
                                    <label>%</label>
                                </div>
                            	<div class="publish_time">
                                	<input type="text" id="second_rate" name="second_rate" value="" />
                                    <label>%</label>
                                </div>
                            	<div class="publish_time">
                                	<input type="text" id="three_rate" name="three_rate" value="" />
                                    <label>%</label>
                                </div>
                                    <label id="rate_msg"></label>

                             </dd>
                        </dl>
                    </li>
                	<li class="formli">
                    	<dl class="clearfix">
                        	<dt><spring:message code='task_info.msg.hostedDeposit' /></dt>
                            <dd class="clearfix">
                            	<select id="is_deposit" name="is_deposit" class="select">
                                	<option value="101001"><spring:message code='task_info.option.hostedDeposit' /></option>
                                    <option value="101002"><spring:message code='task_info.option.noHostedDeposit' /></option>
                                </select>

                             </dd>
                        </dl>
                    </li>
                	<li class="formli">
                    	<dl class="clearfix">
                        	<dt><spring:message code='task_info.msg.chargeCard' /></dt>
                            <dd class="clearfix">
                            	<select id="use_fee" name="use_fee" class="select">
                                    <option value="101002"><spring:message code='task_info.option.doNotUse' /></option>
                                	<option value="101001"><spring:message code='task_info.option.use' /></option>

                                </select>
                                <label><spring:message code='task_info.msg.currentHoldings' arguments="${initData.fee_num}" argumentSeparator=","/></label>
                             </dd>
                        </dl>
                    </li>
                	<li class="formli">
                    	<dl class="clearfix">
                        	<dt><spring:message code='task_info.msg.valueAdded' /></dt>
                            <dd class="clearfix" id="addValueDD">


                                <c:forEach items="${initData.addValue}" var="addValue">

                                    <div class="zsys clearfix">

                                        <input type="checkbox" name="" value="${addValue.id}"  />

                                        <label style="width: 900px;">
                                                ${addValue.name}(￥${addValue.price})
                                            <em>${addValue.description}</em>
                                        </label>
                                    </div>

                                </c:forEach>

                                <input type="hidden" id="addvalue_ids"  name="addvalue_ids" value="">

                             </dd>
                        </dl>
                    </li>
                	<li class="formli">
                    	<dl class="clearfix">
                        	<dt>&nbsp;</dt>
                            <dd class="clearfix">
                            	<input type="button" onclick="f_saveItem()" id="" name="" value="<spring:message code='task_info.button.next' />" class="submitnext" />
                             </dd>
                        </dl>
                    </li>
                </ul>
            </form>
            </div>
        </div>
    </div>
</div>
<div id="footer">

    <!--content-->
    <jsp:include page="../public/footer.jsp"></jsp:include>
</div>

</body>
</html>
